﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace _0912089
{
    public class Label : SingleView
    {
        private SpriteFont _font;
        private string _text;
        private Color _color;

        public string Text
        {
            get { return _text; }
            set { _text = value; }
        }

        public Label(string strFont, string text, Vector2 pos, Color color, float alpha)
        {
            _font = GameBase.Constant.content.Load<SpriteFont>(strFont);
            Size = _font.MeasureString(text);
            Position = pos;
            _text = text;
            _color = color;
            _alpha = alpha;
        }

        public override void draw(GameTime gameTime, SpriteBatch spriteBatch, Color color)
        {
            if (Visible)
            {
                spriteBatch.DrawString(_font, _text, Position, _color * Alpha);
            }
        }
    }
}
